Document DataGrid2 column name derivation rules and TextTemplate read path#299
Document DataGrid2 column name derivation rules and TextTemplate read path#299yscraft wants to merge 1 commit intomendixlabs:mainfrom
Conversation
… path
add troubleshooting section to alter-page.md covering the silent no-op
symptom when column names don't match, and document all three derivation
rules (attribute short name, sanitized caption, col{N} fallback).
add reading TextTemplate section to debug-bson.md Part 10 documenting
the correct TextTemplate → Template → Items traversal path for executor
code, with wrong/correct Go examples. surfaced by issue mendixlabs#116.
AI Code ReviewReview SummaryThis is a documentation-only PR that adds troubleshooting guidance for two specific issues discovered during development. The changes are focused and accurate. What Looks Good
RecommendationApprove. The documentation provides valuable, precise guidance that will prevent future contributors from repeating the same mistakes. It meets all relevant checklist items for documentation changes (no overlap, correct placement, accurate content). No changes needed. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
ako
left a comment
There was a problem hiding this comment.
Code Review — PR #299
Overview: Docs-only follow-up to #298. Two additions to skill files documenting lessons from issue #116. Short, accurate, and useful.
alter-page.md addition
Good troubleshooting section. The three derivation rules are correct and match the fixed code in #298:
- Attribute-bound → short attribute name ✓
- Caption-only → sanitized caption ✓
- All-special-char caption →
col{N}✓
The final tip ("attribute names take priority over captions") is accurate and pre-empts a likely follow-up confusion.
One small wording note: "completes without error but makes no change" implies this is always silent. Worth clarifying why — the column traversal in dSet is intentionally silent for absent keys (documented in page_mutator.go). So this is by design, not a missing error. Optional — the current wording is still accurate.
debug-bson.md addition
The WRONG/CORRECT Go snippet directly shows the mistake and the fix. dGet(template, "Items") on a nil template is safe (iterating a nil bson.D returns nil → empty slice → loop doesn't run), so the example works correctly even without an explicit nil guard.
Breadth note: "This applies to any executor function that reads column headers, button captions, or any other translatable text stored as Forms$ClientTemplate" — good, this generalises the lesson beyond DataGrid2.
Dependency
Must merge after #298 (and after #298's requested changes are addressed — specifically the template = tmpl fallback). If the fallback is dropped from #298, the docs here remain accurate: the CORRECT example already doesn't rely on it.
Overall: Approve — clean, accurate, and useful. Merge after #298.
Summary
Follow-up to #298. Documents two lessons surfaced by issue #116 so future contributors don't repeat the same mistakes.
alter-page.md— adds a troubleshooting section under DataGrid Column Operations explaining the silent no-op symptom when column names don't match ALTER PAGE expectations, and documents all three derivation rules (attribute short name →Description; sanitized caption →Order_Status; all-special-char caption →col{N})debug-bson.md— adds a "Reading TextTemplate in executor code" subsection to Part 10 documenting the correctTextTemplate → Template → Itemstraversal path, with wrong/correct Go examples. The missingTemplatelevel was the root cause of DESCRIBE PAGE widget names don't match ALTER PAGE identifiers #116.Test plan
🤖 Generated with Claude Code